package com.middleware;

import org.redisson.Config;
import org.redisson.Redisson;
import org.redisson.RedissonClient;
import org.redisson.core.RLock;

import java.util.concurrent.TimeUnit;

public class RedisClient1 {

    public static void main(String[] args) throws InterruptedException {

        Config config=new Config();
        config.useSingleServer().setAddress("127.0.0.1"+":"+"6379");
        RedissonClient redisson= Redisson.create(config);
        RLock lock = redisson.getLock("lock");
        lock.lock();

        Thread.sleep(100000);

    }
}
